package com.od.service.serviceImpl;

import com.od.entity.Category;
import com.od.mapper.CategoryMapper;
import com.od.mapper.IndustryCategoryMapper;
import com.od.service.CategoryService;
import com.od.utils.IndustryCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;

    @Autowired
    private IndustryCategoryMapper industryCategoryMapper;

    @Override
    public List<Category> getAllCategories() {
        return categoryMapper.selectAllCategories();
    }

    @Override
    public String getCategoryNameById(int categoryId) {
        return categoryMapper.selectCategoryNameById(categoryId);
    }

    @Override
    public List<IndustryCategory> getIndustryCategory() {
        return industryCategoryMapper.selectAllIndustries();
    }
}
